home *** CD-ROM | disk | FTP | other *** search
- #ifndef _SWARM_
- #define _SWARM_
-
-
-
-
-
- #define TIMES 4 /* number of time positions recorded */
- #define BEEACC 3 /* acceleration of bees */
- #define WASPACC 5 /* maximum acceleration of wasp */
- #define BEEVEL 11 /* maximum bee velocity */
- #define WASPVEL 12 /* maximum wasp velocity */
- #define BORDER 15 /* wasp won't go closer than this to the edge */
-
- /* Macros */
- #define X(t,b) (sp->x[(t)*sp->beecount+(b)])
- #define Y(t,b) (sp->y[(t)*sp->beecount+(b)])
- #define RAND(v) ((rand()%(v))-((v)/2)) /* random number around 0 */
-
-
- #define MAXSCREENS 1
-
-
- typedef struct Segment
- {
- int x1,x2,y1,y2;
- } Segment;
-
-
- typedef struct
- {
- short width;
- short height;
- Rect bounds;
- RgnHandle cliprgn;
- WindowPtr window;
- RGBColor backcolor;
- RGBColor inversebackcolor;
- RGBColor beecolor;
- short beecolorindex;
- short beecount; /* number of bees */
- Segment *segs; /* bee lines */
- Segment *old_segs; /* old bee lines */
- short *x;
- short *y; /* bee positions x[time][bee#] */
- short *xv;
- short *yv; /* bee velocities xv[bee#] */
- short wx[3];
- short wy[3];
- short wxv;
- short wyv;
- } swarmstruct;
-
-
-
-
-
- void *NewSwarm(int batchcount,Rect *bounds,WindowPtr window);
- void SwarmIdle(void *dataptr);
- void DisposeSwarm(void* dataptr);
-
-
- #endif